package com.ztf.room.handel;

import com.ztf.room.utils.Result;
import com.ztf.room.utils.ResultInfo;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalException {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result systemException(Exception e){
        e.printStackTrace();
        return ResultInfo.err(e.getMessage());
    }

}
